import aht20
import unittest

class AHT20UnitTest(unittest.TestCase):
    def test_read(self):
        aht = aht20.AHT20()
        temp, humi = aht.read()
        print('temp:', temp, ' humi:', humi)
        self.assertTrue(temp > -40 and temp < 80)
        self.assertTrue(humi >0 and humi < 100)

    def test_readTemp(self):
        aht = aht20.AHT20()
        temp = aht.readTemp()
        print('temp:', temp)
        self.assertTrue(temp > -40 and temp < 80)

    def test_readHumidity(self):
        aht = aht20.AHT20()
        humi = aht.readHumidity()
        print( ' humi:', humi)
        self.assertTrue(humi >0 and humi < 100)        
